#ifndef _TEXTCLASS_H_
#define _TEXTCLASS_H_

#include "fontclass.h"
#include "fontshaderclass.h"

namespace frost
{
	namespace text
	{
		/** \brief Klass f&ouml;r visning utav text
		*
		* 
		*/
		class TextClass
		{
		private:
			struct SentenceType
			{
				ID3D11Buffer *vertexBuffer, *indexBuffer;
				int vertexCount, indexCount, maxLength;
				float red, green, blue;
			};

			struct VertexType
			{
				D3DXVECTOR3 position;
				D3DXVECTOR2 texture;
			};

		public:
			TextClass();
			TextClass(const TextClass&);
			~TextClass();

			bool Initialize(ID3D11Device*, ID3D11DeviceContext*, HWND, char*, int, int, int, int, D3DXMATRIX);
			void Shutdown();
			bool Render(ID3D11DeviceContext*, D3DXMATRIX, D3DXMATRIX);

			bool SetFps(int, ID3D11DeviceContext*);
			void SetSize(int, int);
			void GetSize(int&, int&);
			void GetPosition(int&, int&);

		private:
			bool InitializeSentence(SentenceType**, int, ID3D11Device*);
			bool UpdateSentence(SentenceType*, char*, int, int, ID3D11DeviceContext*);
			void ReleaseSentence(SentenceType**);
			bool RenderSentence(ID3D11DeviceContext*, SentenceType*, D3DXMATRIX, D3DXMATRIX);
			

		private:
			FontClass* m_Font;
			FontShaderClass* m_FontShader;
			int m_screenWidth, m_screenHeight;
			int m_Xposition, m_Yposition;
			int m_Xsize, m_Ysize;
			D3DXMATRIX m_baseViewMatrix;
			SentenceType* m_sentence1;
			char m_sentence[20];
			float red, green, blue;
		};
	}
}
#endif